"""
学生信息管理URL配置
"""
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views
from .admin_views import StudentManageViewSet

# 创建路由器
router = DefaultRouter()
router.register(r'students', StudentManageViewSet, basename='student-manage')

urlpatterns = [
    # 校区管理
    path('schools/', views.SchoolListCreateView.as_view(), name='school_list_create'),
    path('schools/<int:pk>/', views.SchoolDetailView.as_view(), name='school_detail'),

    # 专业管理
    path('majors/', views.MajorListCreateView.as_view(), name='major_list_create'),
    path('majors/<int:pk>/', views.MajorDetailView.as_view(), name='major_detail'),

    # 年级管理
    path('grades/', views.GradeListCreateView.as_view(), name='grade_list_create'),
    path('grades/<int:pk>/', views.GradeDetailView.as_view(), name='grade_detail'),

    # 师生分配关系
    path('assignments/', views.TeacherStudentAssignmentListCreateView.as_view(), name='assignment_list_create'),
    path('assignments/<int:pk>/', views.TeacherStudentAssignmentDetailView.as_view(), name='assignment_detail'),

    # 我的学生
    path('my-students/', views.my_students, name='my_students'),

    # 管理员分配指导老师
    path('assign-advisor/', views.assign_advisor, name='assign_advisor'),
    path('batch-assign-advisor/', views.batch_assign_advisor, name='batch_assign_advisor'),
    path('advisor-statistics/', views.advisor_statistics, name='advisor_statistics'),

    # 教师列表（用于下拉框）
    path('teachers/', views.teacher_list, name='teacher-list'),

    # 学生管理API（使用ViewSet路由）
    path('', include(router.urls)),
]
